<template>
    <form :action="action" method="post" enctype="multipart/form-data" ref="form" hidden>
        <input type="hidden" v-for="k,v in values" :name="v" :value="k" />
        <input type="hidden" name="md5Sign" :value="md5Sign" />
    </form>
</template>
<script>
import config from 'service/config'
import util from 'service/util'
export default {
    data() {
        return {
            action: config.baseURL + '/order/sign',
            values: {
                'apiVersion': config.apiVersion,
                'devName': config.devName,
                'userId': $store.state.user.userId,
            }
        }
    },
    computed: {
        md5Sign() {
            return util.getMd5Sign(this.values, ['userId'], config.md5ConfigStr)
        }
    },
    methods: {
        submit() {
            if ($store.getters.userLogined && $store.getters.borrowing) this.$refs.form.submit()
        }
    }
}    
</script>
